package cn.italkcloud.cph.service;

import cn.italkcloud.cph.constants.enums.vos.FeeLogTypeEnum;
import cn.italkcloud.cph.entity.VosFeeLog;
import cn.italkcloud.cph.utils.DateUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * @author dominate
 * @since 2024/7/19
 **/
@SpringBootTest
@RunWith(SpringRunner.class)
public class VosFeeLogDebug {

    @Resource
    private IVosFeeLogService vosFeeLogService;
    @Resource
    private VosService vosService;

    @Test
    public void debugAdd() {
        VosFeeLog vosFeeLog = new VosFeeLog()
                .setAccountId(1)
                .setVosCustomerId(1)
                .setType(FeeLogTypeEnum.CONSUME.getCode())
                .setChange(new BigDecimal(200))
                .setBalance(new BigDecimal(200));
        vosFeeLogService.save(vosFeeLog);
    }

    @Test
    public void debugSyncRecharge() {
        vosService.syncRechargeFeeLog(DateUtil.strToDate("2024-11-01"), DateUtil.strToDate("2024-11-31"));
    }
}
